/*
 * TST.c
 *
 *  Created on: Jan 20, 2014
 *      Author: adijoshi
 */
//INCLUDES
#include "includes.h"


/*
 * Function: func_TST
 *
 * Inputs:	 Mnemonic, Address_of_destination
 * Outputs:  (None)
 * Condition  Codes:
 * 		Z:  set  if  result  =  0;  cleared  otherwise
 * 		N:  set  if  result  <  0;  cleared  otherwise
 * 		C:  cleared
 * 		V:  cleared
 */

void func_TST(int mnemonic, unsigned short address_destination)
{
	unsigned short data,result;

	data = read_from_memory(address_destination,DATA);
	result = get_twos_complement(data);

	update_N_flag(TST,result);
	update_Z_flag(result);
	update_V_flag(TST,data,0,result);
	update_C_flag(TST,data,0,result,0);
}
